<template>
	<el-dialog title="表单选择" :visible.sync="pickForm.status" width="35%" :before-close="handleCancel">
		<el-form>
			<el-form-item>
				<el-input placeholder="姓名" :clearable='true' readonly></el-input>
			</el-form-item>
			<el-form-item>
				<el-input placeholder="手机" :clearable='true' readonly></el-input>
			</el-form-item>
			<el-form-item>
				<el-input placeholder="邮箱" :clearable='true' readonly></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" :style="{width:'100%'}">提交</el-button>
			</el-form-item>
		</el-form>
		<span slot="footer" class="dialog-footer">
			<el-button  size="mini" @click="handleCancel">取 消</el-button>
			<el-button  size="mini" type="primary" @click="handleConfirm">确 定</el-button>
		</span>
	</el-dialog>
</template>

<script>

	export default {
		name: 'PickForm',
		data() {
			return {
				pickFormInfo: [
					{
						type:"Input",
						value:'姓名'
					},
					{
						type:"Input",
						value:'手机'
					},
					{
						type:"Input",
						value:'邮箱'
					},
					{
						type:"Button",
						value:'提交'
					}
				]
			}
		},
		computed: {
			pickForm() {
				return this.$store.getters.pickForm
			}
		},
		methods: {
			handleCancel() {
				this.$store.commit('SET_PICK_FORM', false)
			},
			handleConfirm() {
				this.pickForm && this.pickForm.callback && this.pickForm.callback(this.pickFormInfo)
				this.handleCancel()
			}
		}
	}
</script>
